# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kitemmodels
pkgver=5.40.0
pkgrel=0
pkgdesc='Models for Qt Model/View system'
arch="all"
url='https://community.kde.org/Frameworks'
license="LGPL-2.1"
depends=""
depends_dev="qt5-qtbase-dev"
makedepends="$depends_dev extra-cmake-modules qt5-qttools-dev doxygen"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz"
subpackages="$pkgname-dev $pkgname-doc"
options="!check" # Fails due to requiring running X11

build() {
	cmake \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DKDE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	make
}

check() {
	cd "$builddir"
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	cd "$builddir"
	make DESTDIR="${pkgdir}" install
}
sha512sums="17f78419b5860b6423a555d5ab529f68e7589e76b1f0c32f5ff0f581991a480cd9424d86d1384a85c221bb3037491a8fa4a0bf1e20ee7ed046d9be8c76e74446  kitemmodels-5.40.0.tar.xz"
